package com.xinwei.controller;

import com.xinwei.common.ApiRestResponse;
import com.xinwei.service.ClassService;
import com.xinwei.vo.ClassVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/api/class")
@CrossOrigin(origins = "*")
public class ClassController {
    @Autowired
    private ClassService classService;

    @PostMapping("/classList")
    public ApiRestResponse classList(@RequestParam(required = false) Integer grade,
                                     @RequestParam(required = false) Integer professionalId) {
        List<ClassVO> classList = classService.getClassList(grade, professionalId);
        return ApiRestResponse.success(classList);
    }
}
